package service;

import dao.Student;
import dao.Teacher;

public class Login {
    public static boolean validateStudent(String name,String pwd){
        boolean result=false;
        String truePwd= Student.getPwdById(name);
        if(pwd.equals(truePwd)){
            result=true;
        }else{
            result=false;
        }
        return result;
    }
    public static boolean validateTeacher(String name,String pwd){
        boolean result=false;
        String truePwd= Teacher.getPwdById(name);
        if(pwd.equals(truePwd)){  //这里不写truePwd.equals(pwd)是因为truePwd有可能是null
            result=true;
        }else {
            result=false;
        }
        return result;
    }
}
